//package com.example.kiratest.Notify;
//
//import com.alibaba.fastjson.JSON;
//import com.example.kiratest.Notify.Enum.MsgTypeEnum;
//import com.example.kiratest.Notify.POJO.CardRequest;
//import com.example.kiratest.Notify.POJO.DingtalkRowsItem;
//import com.example.kiratest.Notify.POJO.DingtalkTableItem;
//import com.example.kiratest.Notify.POJO.RowsItem;
//import com.example.kiratest.Notify.Util.SmartBeanUtil;
//import jakarta.annotation.Resource;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.collections4.CollectionUtils;
//import org.springframework.stereotype.Service;
//
//import java.util.List;
//import java.util.UUID;
//
//@Slf4j
//@Service
//public class PushPBNotifierManager {
//
//
//    @Resource
//    private CardRequest pbNotifierMsg;
//
//    @Resource
//    private DingtalkNotifier dingtalkNotifier;
//
//
//
//    public void doTask(){
//        //1.获取目标应用包集合
//        List<RowsItem> rowsItems = pbCollectionInfo();
//        if(CollectionUtils.isNotEmpty(rowsItems)) {
//            try {
//                dingtalkNotifier.notify(getDingTalkRebotMsg(rowsItems), null);
//            } catch (Exception e) {
//                log.error("==== withoutpb feishu notify ==== execute err:", e);
//            }
//        }
//
//    }
//
//    private String getDingTalkRebotMsg(List<RowsItem> rowsItems) {
//        List<DingtalkRowsItem> dingTalkRowsItems = SmartBeanUtil.copyList(rowsItems, DingtalkRowsItem.class);
//        pbNotifierMsg.getCardData().getCardParamMap().getTableBean().setData(dingTalkRowsItems);
//        DingtalkTableItem tableBean = pbNotifierMsg.getCardData().getCardParamMap().getTableBean();
//        pbNotifierMsg.getCardData().getCardParamMap().setTable(JSON.toJSONString(tableBean));
//        pbNotifierMsg.setOpenSpaceId(MsgTypeEnum.NOTIFY.getOpenSpaceId());
//        pbNotifierMsg.setCardTemplateId(DingtalkConst.cardTemplateId);
//        pbNotifierMsg.setOutTrackId(UUID.randomUUID().toString());
//        return JSON.toJSONString(pbNotifierMsg);
//    }
//
//
//}
